﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using Visio = Microsoft.Office.Interop.Visio;
/*
namespace Microsoft.Office.Interop.Visio.Extension
{
    public static class VisioEx
    {
        public static Visio.Shape CreateBlock(this Application app, string Name, string Text, string Data = null)
        {  
            var t1 = app.ActiveWindow.Page.Drop(app.Documents["BASIC_M.VSS"].Masters.get_ItemU("Ellipse"), 0, 0);
            t1.Name = Name;
            t1.Data1 = (Data != null) ? Data : "";
            t1.Characters.Text = Text;
            t1.CellsSRC((short)Visio.VisSectionIndices.visSectionObject, (short)Visio.VisRowIndices.visRowXFormOut, (short)Visio.VisCellIndices.visXFormWidth).FormulaU = "TEXTWIDTH(TheText,TxtWidth)+5mm";
            t1.CellsSRC((short)Visio.VisSectionIndices.visSectionObject, (short)Visio.VisRowIndices.visRowXFormOut, (short)Visio.VisCellIndices.visXFormHeight).FormulaU = "TEXTHEIGHT(TheText,TxtHeight)+5mm";

            return t1;
        }
        public static void ConnectShapes(this Application app, Visio.Shape shape1, Visio.Shape shape2)
        {
            Visio.Shape connector = app.ActiveWindow.Page.Drop(app.Documents["BASIC_M.VSS"].Masters.get_ItemU("Dynamic connector"), 0, 0);
            // get the cell from the source side of the connector
            Cell beginXCell = connector.get_CellsSRC(
            (short)Visio.VisSectionIndices.visSectionObject,

            (short)Visio.VisRowIndices.visRowXForm1D,
            (short)Visio.VisCellIndices.vis1DBeginX);
            // glue the source side of the connector to the first shape
            beginXCell.GlueTo(shape1.get_CellsSRC(
            (short)Visio.VisSectionIndices.visSectionObject,
            (short)Visio.VisRowIndices.visRowXFormOut,
            (short)Visio.VisCellIndices.visXFormPinX));
            // get the cell from the destination side of the connector
            Cell endXCell = connector.get_CellsSRC(
            (short)Visio.VisSectionIndices.visSectionObject,
            (short)Visio.VisRowIndices.visRowXForm1D,
            (short)Visio.VisCellIndices.vis1DEndX);
            // glue the destination side of the connector to the second shape
            endXCell.GlueTo(shape2.get_CellsSRC(
            (short)Visio.VisSectionIndices.visSectionObject,
            (short)Visio.VisRowIndices.visRowXFormOut,
            (short)Visio.VisCellIndices.visXFormPinX));
        }
    }
}
*/